<template>
	<view class="p-20 bg-white">

<!-- 		<view class="banmi_input_edit a-c">
			<view class="banmi_input_edit_name">
				首页背景图{{is_plugin_mode}}
			</view>
			<view class="banmi_input_val">
				<upImg ref="upimg" :val='1' name="图片" :count="1" :list="find.index_background_img" t_type="images"
					@confirm="confirm_index_background_img">
				</upImg>
			</view>
		</view>
		<view class="banmi_input_edit a-c">
			<view class="banmi_input_edit_name">
				搜索提示词
			</view>
			<view class="banmi_input_val">
				<uni-easyinput v-model="find.search_placeholder" placeholder="请输入name">
				</uni-easyinput>
			</view>
		</view>

		<view class="banmi_input_edit a-c">
			<view class="banmi_input_edit_name">
				腾讯地图key
			</view>
			<view class="banmi_input_val">
				<uni-easyinput v-model="find.tx_map_key" placeholder="请输入腾讯地图key">
				</uni-easyinput>
			</view>
		</view>
		<view class="banmi_input_edit banmi_flex a-c">
			<view class="banmi_input_edit_name">
				文章审核
			</view>
			<view @click="confirm_article_examine(find.article_examine)">
				<banmi-switch :is_state="find.article_examine" is_type='false'></banmi-switch>
			</view>
		</view>
		<view class="banmi_input_edit banmi_flex a-c">
			<view class="banmi_input_edit_name">
				回复审核
			</view>
			<view @click="confirm_reply_examine(find.reply_examine)">
				<banmi-switch :is_state="find.reply_examine" is_type='false'></banmi-switch>
			</view>
		</view> -->


		<view class="a-c  p-b-20 banmi_input_edit">
			<view class="banmi_input_edit_name">
			</view>
			<view class="">
				<button @click="on_sava()" type="primary" style="width: 80px;" size="mini">保存</button>
			</view>
		</view>

		<!-- 	颜色选择器 -->
		<t-color-picker ref="colorPicker" @confirm="confirm_color"></t-color-picker>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				find: {
					index_background_img: '',
					search_placeholder: ''

				},
				is_plugin_mode: '',
			 
			}
		},
		onLoad() {
			this.is_plugin_mode = uni.getStorageSync('is_plugin_mode')
			this.init();
		 
		},
		methods: {
			confirm_index_background_img(vals) {
				if (vals.length == 0) {
					this.find.index_background_img = ''
					return
				}
				this.find.index_background_img = vals[0]['attachment']
			},
			confirm_article_examine(val) {
				if (val == 'false') {
					this.find.article_examine = 'true'
				} else {
					this.find.article_examine = 'false'
				}

			},
			confirm_reply_examine(val) {
				if (val == 'false') {
					this.find.reply_examine = 'true'
				} else {
					this.find.reply_examine = 'false'
				}

			},
			on_sava() {
				var that = this;
				this.Http.post('banmichaoqiangbizhi/admin/Settings/set_save', this.find).then(ret => {

					uni.showToast({
						title: ret.msg,
						icon: 'none'
					})
				})
			},
			// 
			init() {
				var that = this;
				let requestParams = {};
				this.Http.post('banmichaoqiangbizhi/admin/Settings/set_find', requestParams).then(ret => {
					var find = ret.data.set_find;
					this.find = find;

				})
			},
		}
	}
</script>

<style>

</style>